<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:mvc="http://www.springframework.org/schema/mvc" 
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
           ">  
    <context:annotation-config/>
	<context:component-scan base-package="edu.gtcfla.km"></context:component-scan>

	<!-- message bundle -->
	<bean id="localeChangeInterceptor"  class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
		<property name="paramName" value="lang" />
	</bean> 

	<bean id="localeResolver"  class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
		<property name="defaultLocale" value="zn_CH"/>
	</bean> 

	<bean id="multipartResolver"
	    class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
	    <property name="maxUploadSize" value="100000000"/>
	</bean>

	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" >
		<property name="customArgumentResolvers">
			<list>
				<bean class="org.vsg.search.web.spring.SearchCriteriaArgumentResolver" />
			</list>
		</property>
		<property name="messageConverters">
			<list>
				<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter" />
				<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
				<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
			</list>
		</property>
	</bean>

	<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
		<property name="interceptors">
			<list>
				<ref bean="localeChangeInterceptor" />
			</list>
		</property>
	</bean>
	
	<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
	    <property name="cacheSeconds" value="0" />
	    <property name="webBindingInitializer">
	        <bean class="org.vsg.common.web.binding.DateBinding" />
	    </property>
	</bean>

	<!-- using default path of jsp file -->
	<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
		<property name="mediaTypes">
    		<map>
      			<entry key="htm" value="text/html"/>
      			<entry key="json" value="text/html"/>
      			<entry key="act" value="text/html"/>
      			<entry key="jpg" value="image/jpeg"/>
    		</map>
  		</property>
		<property name="viewResolvers">
			<list>
				<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" 
				p:prefix="/" p:suffix=".jsp"/>
			</list>			
		</property>
	</bean>


</beans>
